package com.yang.springboot.web;

import com.alibaba.dubbo.config.annotation.Reference;
import com.yang.springboot.service.IStudentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author yanwei.yang
 * @date 2021/11/24 17:17
 * @description:
 */
@Controller
@RequestMapping("student")
public class StudentController {

    @Reference(interfaceClass = IStudentService.class, version = "1.0.0", check = false)
    private IStudentService studentService;

    @RequestMapping(value = "count")
    @ResponseBody
    public Object count() {
        Integer count = studentService.queryAllStudentCount();
        return "学生总人数:" + count;
    }
}
